const express = require('express');
const router = express.Router();
const achievementController = require('../controllers/achievementController');
const { authenticate } = require('../middleware/auth');

// 所有路由都需要认证
router.use(authenticate);

router.get('/', achievementController.getAllAchievements);
router.get('/user', achievementController.getUserAchievements);
router.post('/check', achievementController.checkAndUnlockAchievements);
router.get('/progress', achievementController.getAchievementProgress);

module.exports = router;

